{extend name="property/public/insidePageBase" /}
{block name="title"}编辑菜单目录{/block}
{block name="body"}
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-form layui-form-pane">
            <div class="layui-row">
                <div class="layui-col-xs6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">权限图标</label>
                        <div class="layui-input-block">
                            <input type="text" name="icon" id="iconPicker1" value="{$info['icon']??''}" lay-filter="iconPicker2" class="hide">
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">权限排序</label>
                        <div class="layui-input-block">
                            <input type="number" name="sort" lay-verify="number" value="{$info['sort']??''}" autocomplete="off" placeholder="请输入排序号" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">上级分类</label>
                <div class="layui-input-block">
                    <input type="text" name="pid" id="mer_category" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">权限名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" lay-verify="require" value="{$info['name']??''}" autocomplete="off" placeholder="请输入权限名称" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">权限地址</label>
                <div class="layui-input-block">
                    <input type="text" name="rule_url" lay-verify="require" value="{$info['rule_url']??''}" autocomplete="off" placeholder="请输入权限地址" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-hide">
                <button class="layui-btn" lay-submit lay-filter="submitBtn" id="submitBtn">提交</button>
            </div>
        </div>
    </div>
</div>
{/block} {block name="js"} {__block__}
<script>
    layui.use(['iconPickerFa', 'form', 'layer','layCascader'], function() {
        var iconPickerFa = layui.iconPickerFa,  form = layui.form,  layer = layui.layer, $ = layui.$,layCascader = layui.layCascader;
        iconPickerFa.render({
            // 选择器，推荐使用input
            elem: '#iconPicker1',
            // fa 图标接口
            url: "/static/common/lib/font-awesome-4.7.0/less/variables.less",
            // 是否开启搜索：true/false
            search: true,
            // 是否开启分页
            page: true,
            // 每页显示数量，默认12
            limit: 200,
            // 点击回调
            click: function(data) {
                $('#iconPicker1').val('fa ' + data.icon)
            },
            // 渲染成功后的回调
            success: function(d) {}
        });
        let merCategory = layCascader({
            elem: '#mer_category',
            clearable: true,
            value: {$info['pid']??'0'},
            placeholder:'顶级分类',
            props: {
                checkStrictly: true
            },
            options: {:json_encode($ruleNameData,JSON_UNESCAPED_UNICODE)}
        });
    });
</script>
{/block}